#include <QApplication>
#include "qmlapplicationviewer.h"
#include "trafic.h"
#include <QDeclarativeContext>
#include <QDeclarativeComponent>
#include <QDeclarativeView>

QmlApplicationViewer *viewer;

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    Trafic m_trafic;
    viewer = new QmlApplicationViewer();
    Q_INIT_RESOURCE(resource);
    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer->rootContext()->setContextProperty("m_trafic", &m_trafic);
    viewer->setMainQmlFile(QLatin1String("qml/QInfoTrafic_MeeGo/main.qml"));

    viewer->showExpanded();
    return app->exec();
}
void Trafic::charg_fini()
{
    viewer->rootContext()->setContextProperty("Info_Trafic",QVariant::fromValue(parcours));
    viewer->rootContext()->setContextProperty("Info_Size",QVariant::fromValue(parcours.size()));
    viewer->rootContext()->setContextProperty("Info_Temps",QVariant::fromValue(list_temps));
    qDebug() <<"#Taille de la liste des temps" <<list_temps.size();
}
